package com.d0312;

public class AnonyOuterClass {
    private String name="老2";
    private int age =22;
   /*IFoo ifoo =new IFoo() {
        @Override
        public void display() {
            System.out.println(name+"\t"+age);
        }
    };*/
   //IFoo foo =()-> System.out.println("hello");
    //IFoo foo=()->5;
    //IFoo foo=(x,y)->x+y;
    IFoo foo=(String a)-> System.out.println(a+"\t"+name);
   House house=new House() {
       @Override
       public void show() {
           System.out.println(name+"\t"+age);
       }
   };

    public static void main(String[] args) {
        AnonyOuterClass anonyOuterClass=new AnonyOuterClass();
        //anonyOuterClass.ifoo.display();
        anonyOuterClass.house.show();
        anonyOuterClass.foo.showStr("214");
    }
}
@FunctionalInterface
interface IFoo{
   // public void display();
  //  int getResult();
    //int get2Result(int a,int b);
    void showStr(String str);

}
abstract class House{
    public abstract void show();
}